home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsIPrintSettings.idl < prev    next >
Text File  |  2006-05-08  |  10KB  |  281 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is mozilla.org code.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications Corporation.
  19.  * Portions created by the Initial Developer are Copyright (C) 2000
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *   Don Cone <dcone@netscape.com>
  24.  *   Rod Spears <rods@netscape.com>
  25.  *   Roland Mainz <roland.mainz@informatik.med.uni-giessen.de>
  26.  *   Julien Lafon <julien.lafon@gmail.com>
  27.  *
  28.  * Alternatively, the contents of this file may be used under the terms of
  29.  * either of the GNU General Public License Version 2 or later (the "GPL"),
  30.  * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  31.  * in which case the provisions of the GPL or the LGPL are applicable instead
  32.  * of those above. If you wish to allow use of your version of this file only
  33.  * under the terms of either the GPL or the LGPL, and not to allow others to
  34.  * use your version of this file under the terms of the MPL, indicate your
  35.  * decision by deleting the provisions above and replace them with the notice
  36.  * and other provisions required by the GPL or the LGPL. If you do not delete
  37.  * the provisions above, a recipient may use your version of this file under
  38.  * the terms of any one of the MPL, the GPL or the LGPL.
  39.  *
  40.  * ***** END LICENSE BLOCK ***** */
  41.  
  42. #include "nsISupports.idl"
  43.  
  44.  
  45. %{ C++
  46. #include "nsMargin.h"
  47. %}
  48.  
  49. /**
  50.  * Native types
  51.  */
  52.   [ref] native nsNativeMarginRef(nsMargin);
  53.   
  54. interface nsIPrintSession;
  55.  
  56. /**
  57.  * Simplified graphics interface for JS rendering.
  58.  *
  59.  * @status UNDER_REVIEW
  60.  */
  61. [scriptable, uuid(f1094df6-ce0e-42c9-9847-2f663172c38d)]
  62.  
  63. interface nsIPrintSettings : nsISupports
  64. {
  65.   /**
  66.    * PrintSettings to be Saved Navigation Constants
  67.    */
  68.   const unsigned long kInitSaveOddEvenPages   = 0x00000001;
  69.   const unsigned long kInitSaveHeaderLeft     = 0x00000002;
  70.   const unsigned long kInitSaveHeaderCenter   = 0x00000004;
  71.   const unsigned long kInitSaveHeaderRight    = 0x00000008;
  72.   const unsigned long kInitSaveFooterLeft     = 0x00000010;
  73.   const unsigned long kInitSaveFooterCenter   = 0x00000020;
  74.   const unsigned long kInitSaveFooterRight    = 0x00000040;
  75.   const unsigned long kInitSaveBGColors       = 0x00000080;
  76.   const unsigned long kInitSaveBGImages       = 0x00000100;
  77.   const unsigned long kInitSavePaperSize      = 0x00000200;
  78.   const unsigned long kInitSavePaperName      = 0x00000400;
  79.   const unsigned long kInitSavePaperSizeUnit  = 0x00000800;
  80.   const unsigned long kInitSavePaperSizeType  = 0x00001000;
  81.   const unsigned long kInitSavePaperData      = 0x00002000;
  82.   const unsigned long kInitSavePaperWidth     = 0x00004000;
  83.   const unsigned long kInitSavePaperHeight    = 0x00008000;
  84.  
  85.   const unsigned long kInitSaveReversed       = 0x00010000;
  86.   const unsigned long kInitSaveInColor        = 0x00020000;
  87.   const unsigned long kInitSaveOrientation    = 0x00040000;
  88.   const unsigned long kInitSavePrintCommand   = 0x00080000;
  89.   const unsigned long kInitSavePrinterName    = 0x00100000;
  90.   const unsigned long kInitSavePrintToFile    = 0x00200000;
  91.   const unsigned long kInitSaveToFileName     = 0x00400000;
  92.   const unsigned long kInitSavePageDelay      = 0x00800000;
  93.   const unsigned long kInitSaveMargins        = 0x01000000;
  94.   const unsigned long kInitSaveNativeData     = 0x02000000;
  95.   const unsigned long kInitSavePlexName       = 0x04000000;
  96.   const unsigned long kInitSaveShrinkToFit    = 0x08000000;
  97.   const unsigned long kInitSaveScaling        = 0x10000000;
  98.   const unsigned long kInitSaveColorspace     = 0x20000000;
  99.   const unsigned long kInitSaveResolutionName = 0x40000000;
  100.   const unsigned long kInitSaveDownloadFonts  = 0x80000000;
  101.   const unsigned long kInitSaveAll            = 0xFFFFFFFF;
  102.  
  103.   /* Print Option Flags for Bit Field*/
  104.   const long kPrintOddPages     = 0x00000001;
  105.   const long kPrintEvenPages    = 0x00000002;
  106.   const long kEnableSelectionRB = 0x00000004;
  107.  
  108.   /* Print Range Enums */
  109.   const long kRangeAllPages           = 0;
  110.   const long kRangeSpecifiedPageRange = 1;
  111.   const long kRangeSelection          = 2;
  112.   const long kRangeFocusFrame         = 3;
  113.  
  114.   /* Justification Enums */
  115.   const long kJustLeft   = 0;
  116.   const long kJustCenter = 1;
  117.   const long kJustRight  = 2;
  118.  
  119.   /**
  120.    * FrameSet Default Type Constants
  121.    */
  122.   const short kUseInternalDefault    = 0;
  123.   const short kUseSettingWhenPossible = 1;
  124.  
  125.   /**
  126.    * Page Size Type Constants
  127.    */
  128.   const short kPaperSizeNativeData  = 0;
  129.   const short kPaperSizeDefined     = 1;
  130.  
  131.   /**
  132.    * Page Size Unit Constants
  133.    */
  134.   const short kPaperSizeInches      = 0;
  135.   const short kPaperSizeMillimeters = 1;
  136.  
  137.   /**
  138.    * Orientation Constants
  139.    */
  140.   const short kPortraitOrientation  = 0;
  141.   const short kLandscapeOrientation = 1;
  142.  
  143.   /**
  144.    * Print Frame Constants
  145.    */
  146.   const short kNoFrames      = 0;
  147.   const short kFramesAsIs    = 1;
  148.   const short kSelectedFrame = 2;
  149.   const short kEachFrameSep  = 3;
  150.  
  151.   /**
  152.    * How to Enable Frame Set Printing Constants
  153.    */
  154.   const short kFrameEnableNone        = 0;
  155.   const short kFrameEnableAll         = 1;
  156.   const short kFrameEnableAsIsAndEach = 2;
  157.  
  158.   /**
  159.    * Set PrintOptions 
  160.    */
  161.   void SetPrintOptions(in PRInt32 aType, in PRBool aTurnOnOff);
  162.  
  163.   /**
  164.    * Get PrintOptions 
  165.    */
  166.   PRBool GetPrintOptions(in PRInt32 aType);
  167.  
  168.   /**
  169.    * Set PrintOptions Bit field
  170.    */
  171.   PRInt32 GetPrintOptionsBits();
  172.  
  173.   /**
  174.    * Returns W/H in Twips from Paper Size H/W
  175.    */
  176.   void GetPageSizeInTwips(out long aWidth, out long aHeight);
  177.  
  178.   /**
  179.    * Makes a new copy
  180.    */
  181.     nsIPrintSettings clone();
  182.  
  183.   /**
  184.    * Assigns the internal values from the "in" arg to the current object
  185.    */
  186.     void assign(in nsIPrintSettings aPS);
  187.  
  188.   /**
  189.    * Data Members
  190.    */
  191.   [noscript] attribute nsIPrintSession printSession; /* We hold a weak reference */
  192.  
  193.   attribute long    startPageRange;    
  194.   attribute long    endPageRange;    
  195.  
  196.   attribute double  marginTop;     /*  these are in inches */
  197.   attribute double  marginLeft;
  198.   attribute double  marginBottom;
  199.   attribute double  marginRight;
  200.  
  201.   attribute double  scaling;      /* values 0.0 - 1.0 */
  202.   attribute boolean printBGColors; /* Print Background Colors */
  203.   attribute boolean printBGImages; /* Print Background Images */
  204.  
  205.   attribute short   printRange; 
  206.  
  207.   attribute wstring title;
  208.   attribute wstring docURL;
  209.  
  210.   attribute wstring headerStrLeft;
  211.   attribute wstring headerStrCenter;
  212.   attribute wstring headerStrRight;
  213.  
  214.   attribute wstring footerStrLeft;
  215.   attribute wstring footerStrCenter;
  216.   attribute wstring footerStrRight;
  217.  
  218.   attribute short   howToEnableFrameUI;  /* indicates how to enable the frameset UI            */
  219.   attribute boolean isCancelled;         /* indicates whether the print job has been cancelled */
  220.   attribute short   printFrameTypeUsage; /* indicates whether to use the interal value or not  */
  221.   attribute short   printFrameType;
  222.   attribute boolean printSilent;         /* print without putting up the dialog */
  223.   attribute boolean shrinkToFit;         /* shrinks content to fit on page      */
  224.   attribute boolean showPrintProgress;   /* indicates whether the progress dialog should be shown */
  225.  
  226.   /* Additional XP Related */
  227.   attribute wstring paperName;     /* name of paper */
  228.   attribute short   paperSizeType; /* use native data or is defined here */
  229.   attribute short   paperData;     /* native data value */
  230.   attribute double  paperWidth;    /* width of the paper in inches or mm */
  231.   attribute double  paperHeight;   /* height of the paper in inches or mm */
  232.   attribute short   paperSizeUnit; /* paper is in inches or mm */
  233.  
  234.   attribute wstring plexName;      /* name of plex mode (like "simplex", "duplex",
  235.                                     * "tumble" and various custom values) */
  236.  
  237.   attribute wstring colorspace;    /* device-specific name of colorspace, overrides |printInColor| */
  238.   attribute wstring resolutionName;/* device-specific identifer of resolution or quality
  239.                                     * (like "600", "600x300", "600x300x12", "high-res",
  240.                                     * "med-res". "low-res", etc.) */
  241.   attribute boolean downloadFonts; /* enable font download to printer? */
  242.  
  243.   attribute boolean printReversed;
  244.   attribute boolean printInColor;  /* a false means grayscale */
  245.   attribute long    paperSize;     /*  see page size consts */
  246.   attribute long    orientation;   /*  see orientation consts */
  247.   attribute wstring printCommand;
  248.   attribute long    numCopies;
  249.  
  250.   attribute wstring printerName;   /* name of destination printer */
  251.  
  252.   attribute boolean printToFile;
  253.   attribute wstring toFileName;
  254.  
  255.   attribute long    printPageDelay; /* in milliseconds */
  256.   
  257.   /* initialize helpers */
  258.   /**
  259.    * This attribute tracks whether the PS has been initialized 
  260.    * from a printer specified by the "printerName" attr. 
  261.    * If a different name is set into the "printerName" 
  262.    * attribute than the one it was initialized with the PS
  263.    * will then get intialized from that printer.
  264.    */
  265.   attribute boolean isInitializedFromPrinter;
  266.  
  267.   /**
  268.    * This attribute tracks whether the PS has been initialized 
  269.    * from prefs. If a different name is set into the "printerName" 
  270.    * attribute than the one it was initialized with the PS
  271.    * will then get intialized from prefs again.
  272.    */
  273.   attribute boolean isInitializedFromPrefs;
  274.  
  275.   /* C++ Helper Functions */
  276.   [noscript] void SetMarginInTwips(in nsNativeMarginRef aMargin);
  277.   /* Purposely made this an "in" arg */
  278.   [noscript] void GetMarginInTwips(in nsNativeMarginRef aMargin);
  279.  
  280. };
  281.